import request from '@/utils/http'

export function getGoodsList(params) {
  return request.post({
    url: '/disease/health-manager/product/page',
    data: params
  })
}

export function sendAdverseMessage(params) {
  return request.post({
    url: '/disease/health-manager/sendAdverseMessage',
    data: params
  })
}

export function upload(file) {
  const userInfo = JSON.parse(uni.getStorageSync('userInfo'))
  return request.upload({
    url: '/disease/health-manager/upload',
    file: file,
    formData: {
      userId: userInfo.userId
    }
  })
}

export function uploadVideo(serverId, duration) {
  const userInfo = JSON.parse(uni.getStorageSync('userInfo'))
  return request.post({
    url: '/disease/health-manager/open/audio/upload',
    data: {
      userId: userInfo.userId,
      serverId: serverId,
      duration: duration,
      userType: 'health'
    }
  })
}

export function downVideo(serverId) {
  return request.get({
    url: '/disease/health-manager/open/audio/queryByServerId',
    data: {
      serverId: serverId
    }
  })
}

export function queryAccount(empi) {
  return request.get({
    url: `/api/im/account/queryAccount/${empi}`
  })
}

export function sendNotice(empi) {
  return request.get({
    url: `/api/im/account/notice/${empi}`
  })
}
